let formValidate = {
  data(){
    let numberValidator = (rule,value,callback) => {
      if(value===''){
        return callback(new Error(this.$t('m.packaging.quantityValidate1')))
      } else if(isNaN(value)){
        return callback(new Error(this.$t('m.packaging.quantityValidate2')))
      } else if(value<0){
        return callback(new Error(this.$t('m.packaging.quantityValidate3')))
      }
      callback()
    }
    return {
      ruleForm:{
        tsareacode:[{ required:true, message:this.$t('m.packaging.tsareacodeValidate'), trigger:'blur'}],
        quantity:[{ required:true, validator:numberValidator, trigger:'blur'}],
      }
    }
  }
}
export {
  formValidate
}